package com.example.zgdemo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.zgdemo.bean.TSeckillStock;
import com.example.zgdemo.mapper.StockMapper;
import com.example.zgdemo.service.StockService;
import org.springframework.stereotype.Service;

@Service
public class StockServiceImpl extends ServiceImpl<StockMapper, TSeckillStock> implements StockService {

    @Override
    public int getStockCount(Long id) {
        return this.getById(id).getStock();
    }

    @Override
    public int updateStock(Long id, int count) {
        return this.getBaseMapper().updateStock(id, count);
    }
}
